"""Server URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

from django.urls import path
from Web1 import views
from Web1 import views2
app_name = 'Web1'
# 这里是web端的相关后端

urlpatterns = [
    #home部分的相关路由,返回数据
    path('follows/',views.Web1FollowView.as_view(), name='index' ), #返回关注相关的文章
    path('recommendarticles/',views.Web1RecommendView.as_view(),name="recommond_articles"), #返回推荐的文章
    path('questions/', views.Web1QuestionView.as_view(),name="questions"),
    path('disgroups/',views.Web1DisGroupView.as_view(),name="dis_groups"),
    path(r'article/<int:pk>/', views.Web1ArticleView.as_view(),name="article_by_aid"),
    path('question/<int:pk>/',views.Web1QuestionByIDView.as_view(),name="question_by_qid"),
    #数据更新的相关接口
    #添加某篇文章的文章评论
    path('addArticleComments/',views.Web1AddArticleCommentsView.as_view(),name="add_article_comments"),
    #添加某个问题的回答
    path('addQuestionAnswer/',views.Web1AddQuestionAnswerView.as_view(),name="add_question_answer"),
    #用户登录
    path('userlogin',views.Web1UserLoginView.as_view(),name="user_login"),
    #用户注册
    path('register', views.Web1RegisterView.as_view(), name="register"),
    #获取某位用户的关注用户信息
    path('get_follows_by_uid/<int:pk>',views.Web1FollowsByUid.as_view(),name="follows_by_uid"),
    #获取某位用户所有的文章
    path('get_articles_by_uid/<int:pk>',views.Web1ArticlesByUid.as_view(),name="articles_by_uid"),
    #更新用户的信息
    path('update_userinfo/<int:pk>',views.Web1UpdateUserInfo.as_view(), name="update_user_info"),
    #获取所有书籍信息
    path('getBooks/',views.Web1RecommendBooksView.as_view(),name="book_recommend"),
    #获取书籍分类
    path('getCategory/', views.Web1BookCategoryView.as_view(),name="book_category"),
    #获取用户反馈信息post
    path('getFeedback', views.Web1GetFeedbackView.as_view(),name="feedback"),
    #返回电影推荐相关信息
    path('getMovies/', views.Web1GetMoviesView.as_view(),name="movies"),
    #wish相关接口
    path('getWishes/',views.Web1GetWishesView.as_view(),name="wishes"),
    path('pushWishes', views.Web1PushWishesView.as_view(), name="push_wishes"),
    #family_troubles
    path('getFamilyTroubles/', views2.Web1GetFamilyTroublesView().as_view(),name="family_trouble"),
    path('pushFamilyTroubles', views2.Web1PushFamilyTroublesView().as_view(), name="family_trouble"),
    #family_troubles_response
    path('getFamilyTroublesResponse/<int:pk>', views2.Web1GetFamilyTroublesResponseView().as_view(),name="family_trouble_response"),
    path('pushFamilyTroublesResponse', views2.Web1PushFamilyTroublesResponseView().as_view(), name="push_family_trouble_response"),
    #emotion_troubles
    path('getEmotionTroubles/', views2.Web1GetEmotionTroublesView().as_view(),name="emotion_trouble"),
    path('pushEmotionTroubles', views2.Web1PushEmotionTroublesView().as_view(), name="push_emotion_trouble"),
    #emotion_troubles_response
    path('getEmotionTroublesResponse/<int:pk>', views2.Web1GetEmotionTroublesResponseView().as_view(),name="emotion_trouble_response"),
    path('pushEmotionTroublesResponse', views2.Web1PushEmotionTroublesResponseView().as_view(), name="push_emotion_trouble_response"),
    #study_pressure
    path('getStudyPressure/', views2.Web1GetStudyPressureView().as_view(),name="study_pressure"),
    path('pushStudyPressure', views2.Web1PushStudyPressureView().as_view(), name="push_study_pressure"),
    #study_pressure_response
    path('getStudyPressureResponse/<int:pk>', views2.Web1GetStudyPressureResponseView().as_view(),name="study_pressure_response"),
    path('pushStudyPressureResponse', views2.Web1PushStudyPressureResponseView().as_view(), name="push_study_pressure_response"),
    #work_pressure
    path('getWorkPressure/', views2.Web1GetWorkPressureView().as_view(),name="work_pressure"),
    path('pushWorkPressure', views2.Web1PushWorkPressureView().as_view(), name="push_work_pressure"),
    #work_pressure_response
    path('getWorkPressureResponse/<int:pk>', views2.Web1GetWorkPressureResponseView().as_view(),name="work_pressure_response"),
    path('pushWorkPressureResponse', views2.Web1PushWorkPressureResponseView().as_view(), name="push_work_pressure_response"),
    #jieyou
    path('getJieYou/<int:pk>',views2.Web1GetJieYouView().as_view(),name="jieyou"),
    #PsychologicalConsultant
    path('getPsychologicalConsultant/<int:cid>', views2.Web1GetPsychologicalConsultantView().as_view(),name="psychological_consultant")
]
